package com.example.user.myhjjf_app.presenter;

import com.example.user.myhjjf_app.R;
import com.example.user.myhjjf_app.model.Model_Content;
import com.zhy.adapter.abslistview.ViewHolder;
import com.zhy.adapter.abslistview.base.ItemViewDelegate;

/**
 * Created by User on 2017/8/28.
 */

public class Presenter_Cintent_adapter implements ItemViewDelegate<Model_Content.ValueBean> {
    String type;
    public Presenter_Cintent_adapter(String type){
        this.type = type;
    }
    @Override
    public int getItemViewLayoutId() {
        return R.layout.listitem_leibia_item;
    }

    @Override
    public boolean isForViewType(Model_Content.ValueBean item, int position) {
        return true;
    }

    @Override
    public void convert(ViewHolder holder, Model_Content.ValueBean valueBean, int position) {
        String name = type.equals("station") || type.equals("ptn3900")||type.equals("bbu")?valueBean.getName():valueBean.getTitle();
        holder.setText(R.id.tv_name,name+"("+valueBean.getCode()+")");
    }
}
